﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace ComedyLiveOnTheNet
{
    public partial class SignUp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void SubmitUserDetails(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ComedyLiveOnTheNetDataContext db = new ComedyLiveOnTheNetDataContext();

                User user = new User();

                user.Firstname = txtFirstName.Text;
                user.Lastname = txtSurname.Text;
                user.Sex = drpGender.SelectedValue.ToCharArray()[0];
                user.Username = txtUsername.Text;
                user.Password = txtPassword.Text;
                user.Description = txtDesription.Text;

                db.Users.InsertOnSubmit(user);
                db.SubmitChanges();
            }
        }
    }
}